﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace SampleExamDB
{
    class DBAccess
    {
        public static void InsertPerson(List<Person> newPersons) 
        {
            DatingDatabaseEntities entities = new DatingDatabaseEntities();
            for (int i = 0; i < newPersons.Count;i++ )
            {
                if (newPersons[i].Name != null)
                {
                    entities.People.AddObject(newPersons[i]);
                    
                }
            }
            entities.SaveChanges();
        }
    }
}
